fix(agent-isolation): zsh portability + opt-in default-claude alias - #15
Merged
Conversation
The wrapper used three bashisms that broke under zsh: ${!var}
indirect expansion ("bad substitution" in zsh), unquoted parameter
expansion for word-splitting $CLAUDE_ISO_ALLOW (zsh needs ${=var}
or an array), and `command -v claude` for binary lookup (which would
recurse through an `alias claude=claude-iso` if the user adopts the
wrapper as their default). Replace each with a shell-aware form, and
print a one-line stderr banner on each launch so the isolated mode
is visually distinguishable from a plain `claude` session.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a short "Optional — make the isolated wrapper your default claude" subsection under "The clean-env wrapper", documenting the `alias claude='claude-iso'` pattern, the bypass escape hatches (`command claude`, `\claude`), and the trade-off (sessions outside a tracker checkout also run with a stripped env). The script's shell-aware path lookup landed in the previous commit so the alias no longer recurses into itself. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 task
This was referenced Jul 1, 2026
potiuk
pushed a commit
that referenced
this pull request
Jul 1, 2026
…overrides/ (#665) * chore(spec-loop): consolidate implementation plan Collapse "What's been built" to one line per item; all 22 planned work items preserved verbatim; redundant shipped-state notes trimmed. Generated-by: Claude (Opus 4.7) * feat(validator): add override-file contract check for .apache-magpie-overrides/ Add a new SOFT advisory check (check #15) to the skill-and-tool-validator that validates .apache-magpie-overrides/<skill>.md files in adopter repos. Two advisory checks per file: - Structure: the canonical 'apache-magpie agentic override' header comment must be present (confirms the file was created via /magpie-setup override). - Baseline integrity: heuristic scan for patterns attempting to weaken the framework safety / confidentiality / privacy / data-not-instructions baseline (ignore safety, bypass confidentiality, skip privacy-llm-gate, treat external content as instructions, disclose confidential reports). HTML comment lines are excluded from the weakening scan to avoid flagging prose that explains what NOT to do. The directory scanner silently skips repos without an override directory. All violations are SOFT advisory. 21 new tests cover: clean override passes, missing header, each weakening pattern, HTML-comment exclusion, directory scanner, README.md skip, multi-file coverage, and discoverable-without-editing-skill confirmation. Also clears the override-file contract gap from specs/adoption-and-setup.md. Generated-by: Claude (Opus 4.7)
potiuk
pushed a commit
to justinmclean/airflow-steward
that referenced
this pull request
Jul 1, 2026
…visory) Add validate_project_template_drift (check apache#15) to tools/skill-and-tool-validator to mechanically compare projects/_template/ with projects/non-asf-example/ for structural drift, closing the Known gap in specs/project-agnosticism.md. Three SOFT advisory checks under the new template-drift category: 1. README file-list coherence: every file linked in the ## Files section of non-asf-example/README.md must exist on disk. 2. Undocumented files: every .md file in non-asf-example/ (other than README.md) must be mentioned somewhere in its README. 3. Shared-file h2 alignment: for each .md file present in both profiles, h2 section headings are compared. project.md and README.md are excluded since they differ intentionally by organization profile (org-inherited blocks, narrative structure). 22 new tests in TestProjectTemplateDrift cover all checks, the live-repo clean-state assertion, DocToc-stripping, exclusion of parent-traversal and external URLs, and the project.md/README.md exemptions. The live tree produces zero template-drift violations. Updates specs/project-agnosticism.md Known gaps to document the new check and its scope. Generated-by: Claude (Opus 4.7)
potiuk
pushed a commit
that referenced
this pull request
Jul 1, 2026
#663) Add validate_project_template_drift (check #15) to tools/skill-and-tool-validator to mechanically compare projects/_template/ with projects/non-asf-example/ for structural drift, closing the Known gap in specs/project-agnosticism.md. Three SOFT advisory checks under the new template-drift category: 1. README file-list coherence: every file linked in the ## Files section of non-asf-example/README.md must exist on disk. 2. Undocumented files: every .md file in non-asf-example/ (other than README.md) must be mentioned somewhere in its README. 3. Shared-file h2 alignment: for each .md file present in both profiles, h2 section headings are compared. project.md and README.md are excluded since they differ intentionally by organization profile (org-inherited blocks, narrative structure). 22 new tests in TestProjectTemplateDrift cover all checks, the live-repo clean-state assertion, DocToc-stripping, exclusion of parent-traversal and external URLs, and the project.md/README.md exemptions. The live tree produces zero template-drift violations. Updates specs/project-agnosticism.md Known gaps to document the new check and its scope. Generated-by: Claude (Opus 4.7)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/agent-isolation/claude-iso.shportable to zsh: replace${!var}indirect expansion, unquoted-scalar word-split of$CLAUDE_ISO_ALLOW, andcommand -v claudewith shell-aware forms. Print a TTY-aware one-line stderr banner on launch.alias claude='claude-iso'pattern insecure-agent-setup.mdso users who want the isolated wrapper as their defaultclaudecan opt in. The script's path-only lookup (nowtype -P/whence -pinstead ofcommand -v) is what makes the alias safe — without it, the alias would recurse.Test plan
bash -nandzsh -nboth parse the script cleanly.source claude-iso.shdefines theclaude-isofunction in both bash and zsh.prek run --files tools/agent-isolation/claude-iso.sh secure-agent-setup.mdpasses (doctoc, EOF, trailing-whitespace, mixed-line-ending, private-key check).claude-iso --help) emits the banner and exec's claude.🤖 Generated with Claude Code